package com.xd.center.http.handler;

import com.xd.center.http.builder.MethodMetadata;
import com.xd.center.http.proxy.HttpProxy;

/**
 * http方法处理
 */
public class HttpHandler implements MethodHandler {
  private HttpProxy httpProxy;
  private MethodMetadata methodMetadata;

  public HttpHandler(HttpProxy httpProxy, MethodMetadata methodMetadata) {
    this.httpProxy = httpProxy;
    this.methodMetadata = methodMetadata;
  }

  @Override
  public Object invoke(Object[] argv) {
    Object object = httpProxy.execute(methodMetadata, argv, false);
    return object;
  }
}